package com.lovo.consumerSys.serveice.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lovo.consumerSys.entity.UserAddressEntity;
import com.lovo.consumerSys.mapper.IConsumerMapper;
import com.lovo.consumerSys.mapper.IUserAddressMapper;
import com.lovo.consumerSys.serveice.IUserAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class UserAddressServiceImpl implements IUserAddressService {
    @Autowired
    private IUserAddressMapper userAddressMapper;
    @Autowired
    private IConsumerMapper consumerMapper;

    @Override
    public List<UserAddressEntity> findAllAddress() {
        return userAddressMapper.findAllAddress();
    }

    @Override
    public UserAddressEntity findByAddressId(long consumerId) {
        return userAddressMapper.selectById(consumerId);
    }

    @Override
    public void addUserAddress(UserAddressEntity userAddressEntity) {
        userAddressMapper.addUserAddress(userAddressEntity);
    }

    @Override
    public String updateUserAddress(long consumerId, UserAddressEntity userAddressEntity) {
        return null;
    }

    @Override
    public void delUserAddress(long consumerId) {
        userAddressMapper.deleteById(consumerId);
    }

    @Override
    public int updateStatus(long consumerId, int userAddressStatus) {
        return 0;
    }
}
